<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>比较最大值</title>
</head>

<body>
    <script>
        function getMax(n1, n2) {
            n1 = n1;
            n2 = n2;
            if (n1 > n2) {
                return n1;
            } else {
                return n2;
            }
        }
        console.log('6.98和6.99相比\n' + getMax(6.98, 6.99) + '最大');
        console.log('40、70、10相比\n' + getMax(40, 70, 10) + '最大')

        function getMax1(a, b, c) {
            a = a;
            b = b;
            c = c;
            return a > b ? (a > c ? a : c) : (b > c ? b : c);
        }
    </script>
</body>

</html>